package com.itheima.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
//@Aspect
public class DemoAop {
    @Pointcut("execution(* com.itheima.service.impl.EmpServiceImpl.*(..))")
    public void pt(){}
    @Around("pt()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable{
        System.out.println("开始执行目标方法");
        Object ret = pjp.proceed();
        System.out.println("目标方法执行完毕");
        return ret;
    }

}
